package com.ruoyi.appService.information.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
//        import com.rchuing.common.utils.DateUtils;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.appService.information.mapper.ZInformationMapper;
import com.ruoyi.appService.information.domain.ZInformation;
import com.ruoyi.appService.information.service.IZInformationService;

/**
 * 信息Service业务层处理
 *
 * @author yuqihe
 * @date 2025-04-19
 */
@Service
public class ZInformationServiceImpl extends ServiceImpl<ZInformationMapper, ZInformation> implements IZInformationService {
    @Autowired
    private ZInformationMapper zInformationMapper;

    /**
     * 查询信息
     *
     * @param id 信息主键
     * @return 信息
     */
    @Override
    public ZInformation selectZInformationById(Long id) {
        return zInformationMapper.selectZInformationById(id);
    }

    /**
     * 查询信息列表
     *
     * @param zInformation 信息
     * @return 信息
     */
    @Override
    public List<ZInformation> selectZInformationList(ZInformation zInformation) {
        return zInformationMapper.selectZInformationList(zInformation);
    }

    /**
     * 新增信息
     *
     * @param zInformation 信息
     * @return 结果
     */
    @Override
    public int insertZInformation(ZInformation zInformation) {
                zInformation.setCreateTime(DateUtils.getNowDate());
            return zInformationMapper.insertZInformation(zInformation);
    }

    /**
     * 修改信息
     *
     * @param zInformation 信息
     * @return 结果
     */
    @Override
    public int updateZInformation(ZInformation zInformation) {
                zInformation.setUpdateTime(DateUtils.getNowDate());
        return zInformationMapper.updateZInformation(zInformation);
    }

    /**
     * 批量删除信息
     *
     * @param ids 需要删除的信息主键
     * @return 结果
     */
    @Override
    public int deleteZInformationByIds(Long[] ids) {
        return zInformationMapper.deleteZInformationByIds(ids);
    }

    /**
     * 删除信息信息
     *
     * @param id 信息主键
     * @return 结果
     */
    @Override
    public int deleteZInformationById(Long id) {
        return zInformationMapper.deleteZInformationById(id);
    }





    public ZInformation getText(Long id) {
        return zInformationMapper.selectZInformationById(id);
    }
}